package com.keyingbo.leran.pattern.factorypattern.simplefactory;


import com.keyingbo.leran.pattern.factorypattern.Cat;

public class SimpleFactoryTest {
    public static void main(String[] args) {
        String catName = "奔驰";
        Cat cat = CatSimpleFactory.createByName(catName);
        if (cat != null){
            cat.drive();;
        } else {
            System.out.println("未找到此车型:" + catName);
        }
    }
}
